<template>
    <div>

        <div class="main-right">
            <div class="right-nr">
                <router-view></router-view>
            </div>
        </div>

        <div class="clearfix"></div>
    </div>

</template>

<script>
import Nav from "./components/nav"
export default {
    components:{
        Nav
    },
    data(){
        return {
            preIndex:0,
        }
    },
    created(){
        this.centralControl.notice.onBrother("routerChange",(data)=>{
            if(!data){
                return;
            }
            this.transfrom(data);
        })
    },
    methods:{
         //切换
        transfrom(data){
            var arr =  JSON.parse(JSON.stringify(this.data));
             for(var a =0;a<arr.length;a++){
                if(arr[a].path == data.path){
                    arr[a].show = true;
                }else{
                    arr[a].show = false;
                }
             }
             this.data = arr;
        },
        // 点击高亮
        toList(obj,index){
           this.transfrom(obj);
            this.$router.push(obj.path)
        }
    }
}
</script>

<style lang="less" scoped>
.main-left {
    overflow: hidden;
    width: 210px;
    float: left;
    margin-top: 5px;
    min-height: 500px;
    background: #fff;
    border-radius: 10px;
    border: 2px solid #00659B;
    border-radius: 10px;
    //border-image: -webkit-linear-gradient(#9ac330,#eeec90) 30 30;
    //border-image: -moz-linear-gradient(#9ac330,#eeec90) 30 30;
    //
}
.nav-panel-title {
    font-size: 22px;
    color: #00659B;
    font-weight: bold;
    border-bottom: 2px solid #00659B;
    line-height: 50px;
    text-align: center;
    margin: 0 10px;
}
.side-nav-panel {
    padding-bottom: 30px;
}
.slide-nav-ul {
    margin-left: 20px;
}
.slide-nav-ul li {
    position: relative;
    border-bottom: 1px solid #d0d0d0;
}

.slide-nav-ul li a.active, .slide-nav-ul li a:hover {
    color: #00659B;
    background: url(../../assets/img/ablue.png) no-repeat left 21px;
    text-decoration: none;
}
.slide-nav-ul li a {
    cursor: pointer;
    color: #666;
    display: block;
    position: relative;
    padding: 12px 0;
    padding-left: 25px;
    padding-right: 20px;
    font-size: 16px;
    line-height: 25px;
    text-decoration: none;
    background: url(../../assets/img/ayy.png) no-repeat left 21px;
}
.slide-nav-ul .checked-li a{
    color:#00659B;
    background: url(../../assets/img/ablue.png) no-repeat left 21px;
    text-decoration: none;
}
.main-right {
    position: relative;
    width: 870px;
    min-height: 500px;
    float: right;
    margin-top: 5px;
    padding: 20px 20px;
    background: #fff;
    border: 2px solid #00659B;
    border-radius: 10px;
    //border-image: -webkit-linear-gradient(#9ac330,#eeec90) 30 30;
    //border-image: -moz-linear-gradient(#9ac330,#eeec90) 30 30;
    //

}
.right-nr {
    font-size: 16px;
    color: #666;
    position: relative;
    padding-bottom: 50px;
}
</style>
